module BrainlollerTranslators where

-- | Brainloller to Brainfuck translator.
brainlollerToBrainfuck :: [(Int, Int, Int)] -> [Char]
brainlollerToBrainfuck txt = map (brainlollerToBrainfuckChars) txt

-- | Translates a Brainloller RGB code character into a Brainfuck character
brainlollerToBrainfuckChars ::  (Int, Int, Int) -> Char
brainlollerToBrainfuckChars (0,255,0) = '+'
brainlollerToBrainfuckChars (0,128,0) = '-'
brainlollerToBrainfuckChars (255,0,0) = '<'
brainlollerToBrainfuckChars (128,0,0) = '>'
brainlollerToBrainfuckChars (0,0,128) = ','
brainlollerToBrainfuckChars (0,0,255) = '.'
brainlollerToBrainfuckChars (255,255,0) = '['
brainlollerToBrainfuckChars (128,128,0) = ']'
brainlollerToBrainfuckChars (_,_,_) = ' '
